package com.probiz.estore.exports.service;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import com.probiz.estore.exports.model.Column;

public interface BaseExportManager{
	/**
	 * 获取要导出的列信息
	 * @param list
	 * @return
	 */
	public List<Column> getColumns(List<Object> list);
	/**
	 * 获取要导出的源数据
	 * @param ids
	 * @return
	 */
	public List<Object> getDataSource(String[] ids);
	/**
	 * 导出主要方法
	 * @param list
	 * @param workbook
	 */
	public void buildExcel(List<Object> list, HSSFWorkbook workbook);
	/**
	 * 判断是否有子类 (例如：产品的多个sku)
	 * @param target
	 * @return
	 */
	public boolean ifExistChildren(Object target);
	/**
	 * 有子类的导出实现
	 * @param target
	 * @param sheet
	 * @param columns
	 * @param listHeader
	 * @param rowIdx
	 * @return
	 */
	public Integer buildExcelChildren(Object target, HSSFSheet sheet, List<Column> columns, List<String> listHeader, Integer rowIdx );
}
